﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DungeonCraft
{
    public class Camera
    {
        public DataModel.Player player;
        public double Zoom = 4;
        public int width;
        public int height;

        public Camera(DataModel.Player player)
        {
            this.player = player;
        }

        public Camera(DataModel.Player player, int width, int height)
        {
            // TODO: Complete member initialization
            this.player = player;
            this.width = width;
            this.height = height;
        }

        public int calcDisplayX(int x)
        {

            return Convert.ToInt32(Math.Floor((x - player.Location.X) * Zoom) + (width / 2));
        }

            public int calcDisplayY(int y)
        {

            return Convert.ToInt32(Math.Floor((y - player.Location.Y) * Zoom) + (height / 2));
        }

            public int calcInputX(int x)
            {

                return Convert.ToInt32(Math.Floor((x - (width / 2)) / Zoom + player.Location.X));
            }

            public int calcInputY(int y)
            {

                return Convert.ToInt32(Math.Floor((y - (height / 2)) / Zoom + player.Location.Y));
            }
    }
}
